<?php namespace App\Models;

use CodeIgniter\Model;

class UserMsgModel extends Model
{
    protected $table      = 'user-msg';   // 数据库表
    protected $primaryKey = 'id';      // 主键

    protected $returnType     = 'array';
    protected $useSoftDeletes = true;

    protected $allowedFields = [         //  表的字段
        'username',
        'password',
        'sex',
        'email',
        'name',
        'address',
        'token',
        'registerTime',
        'isDelete',
    ];

    protected $useTimestamps = false;

    // 注意：必须要定义这下面的3个字段，不可以为空或者空字符串, 可以是为同一个字段
    protected $createdField  = 'registerTime';
    protected $updatedField  = 'updateTime';
    protected $deletedField  = 'deleteTime';

    protected $validationRules    = [];
    protected $validationMessages = [];
    protected $skipValidation     = false;
}